using System;
using System.Data;
using System.Collections.Generic;
using ADOBase;
namespace eTMS.DAO{
	/********************************BEGIN LoaiDiemDAO****************************************/
	///<summary>
	/// <para>Author: Auto generated class by CSharp Code Generator v2.0</para>
	/// <para>Date:26/10/2011 34:05:09</para>
	/// <para>Class Name: LoaiDiemDAO</para>
	/// <para>Description: Class access to table LoaiDiem in database. Coder should'nt code here.</para>
	///</summary>

	
	public partial class LoaiDiemDAO : DAOBase<LoaiDiemEntity>{


		#region Select functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateSelectOneCommand</para>
		/// <para>Input: LoaiDiem_ID</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectOneCommand(int LoaiDiem_ID){
			string strSQL="SELECT  [LoaiDiem_ID],[MaLoaiDiem],[TenLoaiDiem],[HeSo],[GhiChu],[IsDiemTongKet] FROM [LoaiDiem]  WHERE [LoaiDiem].[LoaiDiem_ID]=@LoaiDiem_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@LoaiDiem_ID",LoaiDiem_ID);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SelectOne</para>
		/// <para>Input: LoaiDiem_ID</para>
		/// <para>Output: LoaiDiemEntity</para>
		///</summary>
		public LoaiDiemEntity SelectOne(int LoaiDiem_ID){
			IDbCommand cmd=this.CreateSelectOneCommand(LoaiDiem_ID);
			return this.Select(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SelectOneByMaLoaiDiem</para>
		/// <para>Input: MaLoaiDiem</para>
		/// <para>Output: LoaiDiemEntity</para>
		///</summary>
		public LoaiDiemEntity SelectOneByMaLoaiDiem(string MaLoaiDiem){
			IDbCommand cmd=this.CreateSelectAllByKeyCommand("MaLoaiDiem",MaLoaiDiem);
			return this.Select(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateSelectAllCommand</para>
		/// <para>Input: </para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllCommand(){
			string strSQL="SELECT  [LoaiDiem_ID],[MaLoaiDiem],[TenLoaiDiem],[HeSo],[GhiChu],[IsDiemTongKet] FROM [LoaiDiem] ";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateSelectAllByKeyCommand</para>
		/// <para>Input: ColumnName,ColumnValue</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllByKeyCommand(string ColumnName,object Value){
			string strSQL="SELECT  [LoaiDiem_ID],[MaLoaiDiem],[TenLoaiDiem],[HeSo],[GhiChu],[IsDiemTongKet] FROM [LoaiDiem]  WHERE [LoaiDiem].["+ColumnName+"]=@ColumnName";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@ColumnName",Value);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SelectAll</para>
		/// <para>Input: </para>
		/// <para>Output: List of LoaiDiemEntity</para>
		///</summary>
		public List<LoaiDiemEntity> SelectAll(){
			IDbCommand cmd=this.CreateSelectAllCommand();
			return this.SelectList(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SelectAllDS</para>
		/// <para>Input: </para>
		/// <para>Output: DataSet</para>
		///</summary>
		public DataSet SelectAllDS(){
			IDbCommand cmd=this.CreateSelectAllCommand();
			return this.SelectDS(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateSelectAllFilterCommand</para>
		/// <para>Input: </para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllFilterCommand(string strFilter){
			string strSQL="SELECT  [LoaiDiem_ID],[MaLoaiDiem],[TenLoaiDiem],[HeSo],[GhiChu],[IsDiemTongKet] FROM [LoaiDiem]  WHERE "+RemoveInjection(strFilter);
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateSelectAllByKeyFilterCommand</para>
		/// <para>Input: ColumnName,ColumnValue</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllByKeyFilterCommand(string strFilter,string ColumnName,object Value){
			string strSQL="SELECT  [LoaiDiem_ID],[MaLoaiDiem],[TenLoaiDiem],[HeSo],[GhiChu],[IsDiemTongKet] FROM [LoaiDiem]  WHERE [LoaiDiem].["+ColumnName+"]=@ColumnName AND "+RemoveInjection(strFilter);
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@ColumnName",Value);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SelectAll</para>
		/// <para>Input: </para>
		/// <para>Output: List of LoaiDiemEntity</para>
		///</summary>
		public List<LoaiDiemEntity> SelectAllFilter(string strFilter){
			IDbCommand cmd=this.CreateSelectAllFilterCommand(strFilter);
			return this.SelectList(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SelectAllDSFilter</para>
		/// <para>Input: </para>
		/// <para>Output: DataSet</para>
		///</summary>
		public DataSet SelectAllDSFilter(string strFilter){
			IDbCommand cmd=this.CreateSelectAllFilterCommand(strFilter);
			return this.SelectDS(cmd);
		}
		#endregion

		#region Insert functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateInsertCommand</para>
		/// <para>Input: LoaiDiemEntity</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateInsertCommand(LoaiDiemEntity o){
			string strSQL="INSERT INTO [LoaiDiem]([MaLoaiDiem],[TenLoaiDiem],[HeSo],[GhiChu],[IsDiemTongKet]) VALUES  (@MaLoaiDiem,@TenLoaiDiem,@HeSo,@GhiChu,@IsDiemTongKet);SELECT  @@IDENTITY";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			if(o.IsNullMaLoaiDiem)
				this.CreateCommandParameter(cmd,"@MaLoaiDiem",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@MaLoaiDiem",o.MaLoaiDiem);

			if(o.IsNullTenLoaiDiem)
				this.CreateCommandParameter(cmd,"@TenLoaiDiem",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@TenLoaiDiem",o.TenLoaiDiem);

			if(o.IsNullHeSo)
				this.CreateCommandParameter(cmd,"@HeSo",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@HeSo",o.HeSo);

			if(o.IsNullGhiChu)
				this.CreateCommandParameter(cmd,"@GhiChu",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@GhiChu",o.GhiChu);

			if(o.IsNullIsDiemTongKet)
				this.CreateCommandParameter(cmd,"@IsDiemTongKet",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@IsDiemTongKet",o.IsDiemTongKet);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: Save</para>
		/// <para>Input: LoaiDiemEntity</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool Save(LoaiDiemEntity o){
			bool result=false;
			IDbCommand cmd=this.CreateInsertCommand(o);
			object id=this.ExecuteScalar(cmd,ref result);
			cmd.Dispose();
			try{
				o.LoaiDiem_ID=int.Parse(Convert.ToString(id));
			}
			catch{}
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SaveList</para>
		/// <para>Input: List of LoaiDiemEntity</para>
		/// <para>Output: </para>
		///</summary>
		public void SaveList(List<LoaiDiemEntity>list){
			foreach(LoaiDiemEntity o in list){
				try{
					this.Save(o);
				}
				catch{
				}
			}
		}
		#endregion

		#region Update functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateUpdateCommand</para>
		/// <para>Input: LoaiDiemEntity</para>
		/// <para>Output: </para>
		///</summary>
		protected IDbCommand CreateUpdateCommand(LoaiDiemEntity o){
			string strSQL="UPDATE  [LoaiDiem] SET [LoaiDiem].[MaLoaiDiem]=@MaLoaiDiem,[LoaiDiem].[TenLoaiDiem]=@TenLoaiDiem,[LoaiDiem].[HeSo]=@HeSo,[LoaiDiem].[GhiChu]=@GhiChu,[LoaiDiem].[IsDiemTongKet]=@IsDiemTongKet WHERE [LoaiDiem].[LoaiDiem_ID]=@LoaiDiem_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			if(o.IsNullLoaiDiem_ID)
				this.CreateCommandParameter(cmd,"@LoaiDiem_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@LoaiDiem_ID",o.LoaiDiem_ID);

			if(o.IsNullMaLoaiDiem)
				this.CreateCommandParameter(cmd,"@MaLoaiDiem",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@MaLoaiDiem",o.MaLoaiDiem);

			if(o.IsNullTenLoaiDiem)
				this.CreateCommandParameter(cmd,"@TenLoaiDiem",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@TenLoaiDiem",o.TenLoaiDiem);

			if(o.IsNullHeSo)
				this.CreateCommandParameter(cmd,"@HeSo",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@HeSo",o.HeSo);

			if(o.IsNullGhiChu)
				this.CreateCommandParameter(cmd,"@GhiChu",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@GhiChu",o.GhiChu);

			if(o.IsNullIsDiemTongKet)
				this.CreateCommandParameter(cmd,"@IsDiemTongKet",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@IsDiemTongKet",o.IsDiemTongKet);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateUpdateFieldCommand</para>
		/// <para>Input: ColumnName,ColumnValue,LoaiDiem_ID</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateUpdateFieldCommand(string ColumnName,object Value,int LoaiDiem_ID){
			string strSQL="UPDATE  [LoaiDiem] SET [LoaiDiem].["+ColumnName+"]=@ColumnName WHERE [LoaiDiem].[LoaiDiem_ID]=@LoaiDiem_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@LoaiDiem_ID",LoaiDiem_ID);



			this.CreateCommandParameter(cmd,"@ColumnName",Value);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: Update</para>
		/// <para>Input: LoaiDiemEntity</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool Update(LoaiDiemEntity o){
			IDbCommand cmd=this.CreateUpdateCommand(o);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateList</para>
		/// <para>Input: List of LoaiDiemEntity</para>
		/// <para>Output: </para>
		///</summary>
		public void UpdateList(List<LoaiDiemEntity>list){
			foreach(LoaiDiemEntity o in list){
				try{
					this.Update(o);
				}
				catch{
				}
			}
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateMaLoaiDiem</para>
		/// <para>Input: NewMaLoaiDiem,LoaiDiem_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateMaLoaiDiem(string NewMaLoaiDiem,int LoaiDiem_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("MaLoaiDiem",NewMaLoaiDiem,LoaiDiem_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateTenLoaiDiem</para>
		/// <para>Input: NewTenLoaiDiem,LoaiDiem_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateTenLoaiDiem(string NewTenLoaiDiem,int LoaiDiem_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("TenLoaiDiem",NewTenLoaiDiem,LoaiDiem_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateHeSo</para>
		/// <para>Input: NewHeSo,LoaiDiem_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateHeSo(Decimal NewHeSo,int LoaiDiem_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("HeSo",NewHeSo,LoaiDiem_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateGhiChu</para>
		/// <para>Input: NewGhiChu,LoaiDiem_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateGhiChu(string NewGhiChu,int LoaiDiem_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("GhiChu",NewGhiChu,LoaiDiem_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateIsDiemTongKet</para>
		/// <para>Input: NewIsDiemTongKet,LoaiDiem_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateIsDiemTongKet(bool NewIsDiemTongKet,int LoaiDiem_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("IsDiemTongKet",NewIsDiemTongKet,LoaiDiem_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		#endregion

		#region Delete functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: DeleteAllCommand</para>
		/// <para>Input: </para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteAllCommand(){
			string strSQL="DELETE   FROM [LoaiDiem]  ";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: DeleteCommand</para>
		/// <para>Input: LoaiDiemEntity</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteCommand(LoaiDiemEntity o){
			string strSQL="DELETE   FROM [LoaiDiem]   WHERE [LoaiDiem].[LoaiDiem_ID]=@LoaiDiem_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			if(o.IsNullLoaiDiem_ID)
				this.CreateCommandParameter(cmd,"@LoaiDiem_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@LoaiDiem_ID",o.LoaiDiem_ID);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: DeleteAll</para>
		/// <para>Input: </para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool DeleteAll(){
			IDbCommand cmd=this.CreateDeleteAllCommand();
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateDeleteByPrimaryKeyCommand</para>
		/// <para>Input: LoaiDiem_ID</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteByPrimaryKeyCommand(int LoaiDiem_ID){
			string strSQL="DELETE   FROM [LoaiDiem]   WHERE [LoaiDiem].[LoaiDiem_ID]=@LoaiDiem_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@LoaiDiem_ID",LoaiDiem_ID);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateDeleteByKeyCommand</para>
		/// <para>Input: ColumnName , ColumnValue</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteByKeyCommand(string ColumnName,object Value){
			string strSQL="DELETE   FROM [LoaiDiem]   WHERE [LoaiDiem].["+ColumnName+"]=@ColumnName";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@ColumnName",Value);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: Delete</para>
		/// <para>Input: LoaiDiemEntity</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool Delete(LoaiDiemEntity o){
			IDbCommand cmd=this.CreateDeleteCommand(o);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: DeleteByID</para>
		/// <para>Input: LoaiDiem_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool DeleteByID(int LoaiDiem_ID){
			IDbCommand cmd=this.CreateDeleteByPrimaryKeyCommand(LoaiDiem_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		#endregion

		#region Select,delete by LoaiDiem_ID functions
		#endregion

		#region MapObject functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: MapObject</para>
		/// <para>Input: IDataReader</para>
		/// <para>Output: LoaiDiemEntity</para>
		///</summary>
		protected override LoaiDiemEntity MapObject(IDataReader r){
			LoaiDiemEntity entity = new LoaiDiemEntity();
			try{
				if(r.FieldCount>0){
					try
					{
						int ordinal = r.GetOrdinal("LoaiDiem_ID");
						if (!r.IsDBNull(ordinal)) entity.LoaiDiem_ID = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("MaLoaiDiem");
						if (!r.IsDBNull(ordinal)) entity.MaLoaiDiem = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("TenLoaiDiem");
						if (!r.IsDBNull(ordinal)) entity.TenLoaiDiem = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("HeSo");
						if (!r.IsDBNull(ordinal)) entity.HeSo = (Convert.ToDecimal(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("GhiChu");
						if (!r.IsDBNull(ordinal)) entity.GhiChu = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("IsDiemTongKet");
						if (!r.IsDBNull(ordinal)) entity.IsDiemTongKet = ((bool)(r.GetValue(ordinal)));
					}
					catch{}
					return entity;
				}
			}catch{}
			return null;
		}
		#endregion
	}
	/*****************************************************************************************************/
	/**********************************END LoaiDiemDAOBase*****************************************/
	/*****************************************************************************************************/
}

